Drawing with the Fourier series

Deriving the Fourier series:

The Fourier series is the idea that any given function can be represented by a sum of sinusoids with varying amplitudes and frequencies. In particular, sin and cosine.

Firstly, let’s examine the properties of cosine. A sine function has a period of \(2\pi\) and is an even function. This means that when we create a sum of cosine functions the resulting function will retain these properties - namely, continue to be a periodic and an even function regardless of their amplitude or frequency. These sums can be represented as:

\[\displaystyle\sum_{n=1} ^{\infty} a_n \cos(\frac{n 2\pi}{T}\ x)\]

Where \(n={1,2,3...}\) and \(T\) is the period

The same can be applied for sine functions, however,they will be odd instead:

\[\displaystyle\sum_{n=1} ^{\infty} b_n \sin(\frac{n 2\pi}{T}\ x)\]

Therefore, any arbitrary function can be composed of these even and odd parts, without being even or odd itself. Therefore, the sum of these sinusoids will allow us to represent any periodic function:

\[F(x)=\displaystyle\sum_{n=1} ^{\infty} a_n \cos(\frac{n 2\pi}{T}\ x)+\displaystyle\sum_{n=1} ^{\infty} a_n \sin(\frac{n 2\pi}{T}\ x)\]

A constant should also be added to account for sinusoids with “zero” frequency. Let this variable be \(a_0\):

\[F(x)=a_0+\displaystyle\sum_{n=1} ^{\infty} a_n \cos(\frac{n 2\pi}{T}\ x)+\displaystyle\sum_{n=1} ^{\infty} b_n \sin(\frac{n 2\pi}{T}\ x)\]

Finally, as we have a general equation for the representation of any function \(F(x)\).

Exponential form of the Fourier series

We can now rewrite this equation in exponential form as it is in trignometric form currently. This can be done by using Euler’s formulas:

\[\begin{align} \cos(x)=\frac{e^{ix}+e^{-ix}}{2} \\ \sin(x)=\frac{e^{ix}-e^{-ix}}{2i} \end{align}\] \[\begin{align} \cos(\frac{n 2\pi}{T}\ x)=\frac{e^{\frac{n 2\pi}{T}\ x}+e^{-\frac{n 2\pi}{T}\ x}}{2} \\ \sin(\frac{n 2\pi}{T}\ x)=\frac{e^{\frac{n 2\pi}{T}\ x}-e^{-\frac{n 2\pi}{T}\ x}}{2i} \end{align}\]

substituting this equation in to our original trignometric form of the Fourier series yields the following:

\[F(x)= a_0+\displaystyle\sum_{n=1} ^{\infty} a_n \frac{e^{\frac{n 2\pi}{T}\ x}+e^{-\frac{n 2\pi}{T}\ x}}{2}+\displaystyle\sum_{n=1} ^{\infty} b_n \frac{e^{\frac{n 2\pi}{T}\ x}-e^{-\frac{n 2\pi}{T}\ x}}{2i}\]

Factoring out like terms we get:

\[F(x) = a_0+\displaystyle\sum_{n=1} ^{\infty}\frac{(a_n-ib_n)e^{\frac{n 2\pi}{T}}}{2}+\frac{(a_n+ib_n)e^{-\frac{n 2\pi}{T}}}{2}\]